﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using BaseRun;

namespace WindowsFormsApp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Run(string dll_path)
        {
            var path = dll_path;
            var ass = System.Reflection.Assembly.LoadFrom(path);
            foreach (var t in ass.GetTypes())
            {
                if (t.GetInterface("IMathOp") != null)
                {
                    IMathOp one = Activator.CreateInstance(t) as IMathOp;
                    one.InA(32);
                    one.InB(32);
                    Console.WriteLine(one.MathAdd());
                    Console.WriteLine(one.Name());
                }
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Run("dll\\ABCRun.dll");

            Run("dll\\CCDRun.dll");

        }
    }
}
